home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form frmOrgChart
- BackColor = &H00FFFFFF&
- Caption = "ORGCHARTER"
- ClientHeight = 6216
- ClientLeft = 888
- ClientTop = 1980
- ClientWidth = 9384
- ForeColor = &H00FFFFFF&
- Height = 6864
- Icon = ORGCHART.FRX:0000
- Left = 840
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 6216
- ScaleWidth = 9384
- Top = 1380
- Width = 9480
- Begin ITGraph itgOrgChart
- ArrangeMode = 3 'Tree
- AutoArrange = 0 'Manual Arrange
- AutoMouseEvents = ORGCHART.FRX:0302
- BackColor = &H00FFFFFF&
- DragItems = 0 'False
- DrawArrows = 0 'False
- DrawBackLinks = 1 'ITG_SolidBackLinks
- DrawColored = -1 'True
- DrawConnLabels = -1 'True
- DrawDir = 3 'Top To Bottom
- DrawHandles = -1 'True
- DrawItemLabels = -1 'True
- DrawScale = 100
- FillColor = &H00FFFFFF&
- ForeColor = &H00000000&
- Gap = 10
- GraphicAllowImport= 0 'No Import
- Graphics = ORGCHART.FRX:0332
- Height = 1776
- Left = 1872
- LineWidth = 0
- PrintHeader = ""
- PrintRectHeight = -1
- PrintRectLeft = -1
- PrintRectTop = -1
- PrintRectWidth = -1
- Redraw = -1 'True
- RubberBand = 1 'RB For Items
- SelectedIndex = -1
- SelectRectEnabled= 0 'False
- SelectRectHeight= 0
- SelectRectLeft = 0
- SelectRectTop = 0
- SelectRectWidth = 0
- StoreGraphics = 2 'Save Referenced Graphics
- TabIndex = 0
- Top = 972
- Width = 2388
- XSpace = 20
- XSpan = 120
- YSpace = 0
- YSpan = 50
- End
- Begin Menu File
- Caption = "&File"
- Begin Menu File_Clear
- Caption = "&Clear"
- End
- Begin Menu File_Print
- Caption = "&Print"
- End
- Begin Menu bar
- Caption = "-"
- End
- Begin Menu File_Exit
- Caption = "E&xit"
- End
- End
- Begin Menu Edit
- Caption = "&Edit"
- Begin Menu Edit_AddNew
- Caption = "&Add New"
- End
- Begin Menu Edit_Delete
- Caption = "&Delete"
- End
- Begin Menu Edit_bar
- Caption = "-"
- End
- Begin Menu Edit_ClearText
- Caption = "&Clear Text"
- End
- End
- Begin Menu Appearance
- Caption = "A&ppearance"
- Begin Menu MouseDrag
- Caption = "&Mouse Drag"
- Begin Menu App_Mouse_Connect
- Caption = "&Connect Nodes"
- End
- Begin Menu App_Mouse_MoveNodes
- Caption = "&Move Nodes"
- End
- End
- Begin Menu ScreenSize
- Caption = "&Screen Size"
- Begin Menu App_ScrSize_Standard
- Caption = "S&tandard (VGA)"
- End
- Begin Menu App_ScrSize_FitToScreen
- Caption = "&Fit To Screen"
- End
- End
- Begin Menu NodeSize
- Caption = "Node Si&ze"
- Begin Menu App_Size_Large
- Caption = "&Large (250 x 100)"
- End
- Begin Menu App_Size_Medium
- Caption = "&Medium (200 x 75)"
- End
- Begin Menu App_Size_Small
- Caption = "&Small (150 x 50)"
- End
- End
- Begin Menu Arrange_Scale
- Caption = "&Scale..."
- Begin Menu Arrange_Scale_100
- Caption = "100%"
- End
- Begin Menu Arrange_Scale_Fit
- Caption = "Fit To Screen"
- End
- End
- End
- Begin Menu Arrange
- Caption = "&Arrange"
- Begin Menu Arrange_Now
- Caption = "&Now"
- End
- Begin Menu Arrange_OnNewConn
- Caption = "&On New Connection"
- End
- End
- Dim i_selnodeix As Integer
- Sub AllWhite ()
- Dim i%
- For i = 0 To itgOrgChart.ListCount
- itgOrgChart.ItemFillColor(i) = WHITE
- Edit_Delete.Enabled = False
- Edit_ClearText.Enabled = False
- Next i
- End Sub
- Sub App_Mouse_Connect_Click ()
- itgOrgChart.DragItems = False
- App_Mouse_Connect.Checked = True
- App_Mouse_MoveNodes.Checked = False
- End Sub
- Sub App_Mouse_MoveNodes_Click ()
- itgOrgChart.DragItems = True
- App_Mouse_Connect.Checked = False
- App_Mouse_MoveNodes.Checked = True
- End Sub
- Sub App_ScrSize_FitToScreen_Click ()
- Me.Width = Screen.Width
- Me.Height = Screen.Height
- Call CenterForm(Me)
- Call DrawChart(Me)
- App_ScrSize_Standard.Checked = False
- App_ScrSize_FitToScreen.Checked = True
- End Sub
- Sub App_ScrSize_Standard_Click ()
- Me.Width = 640 * Screen.TwipsPerPixelX
- Me.Height = 480 * Screen.TwipsPerPixelY
- Call CenterForm(Me)
- Call DrawChart(Me)
- App_ScrSize_Standard.Checked = True
- App_ScrSize_FitToScreen.Checked = False
- End Sub
- Sub App_Size_Large_Click ()
- itgOrgChart.XSpan = 250
- itgOrgChart.YSpan = 100
- itgOrgChart.AutoArrange = ITG_ArrangeNow
- App_Size_Large.Checked = True
- App_Size_Medium.Checked = False
- App_Size_Small.Checked = False
- End Sub
- Sub App_Size_Medium_Click ()
- itgOrgChart.XSpan = 200
- itgOrgChart.YSpan = 75
- itgOrgChart.AutoArrange = ITG_ArrangeNow
- App_Size_Large.Checked = False
- App_Size_Medium.Checked = True
- App_Size_Small.Checked = False
- End Sub
- Sub App_Size_Small_Click ()
- itgOrgChart.XSpan = 150
- itgOrgChart.YSpan = 50
- itgOrgChart.AutoArrange = ITG_ArrangeNow
- App_Size_Large.Checked = False
- App_Size_Medium.Checked = False
- App_Size_Small.Checked = True
- End Sub
- Sub Arrange_Now_Click ()
- If Arrange_OnNewConn.Checked = True Then
- itgOrgChart.AutoArrange = ITG_AutoArrange
- Else
- itgOrgChart.AutoArrange = ITG_ArrangeNow
- End If
- End Sub
- Sub Arrange_OnNewConn_Click ()
- Arrange_OnNewConn.Checked = Not Arrange_OnNewConn.Checked
- If Arrange_OnNewConn.Checked = True Then
- itgOrgChart.AutoArrange = ITG_AutoArrange
- Else
- itgOrgChart.AutoArrange = ITG_ManualArrange
- End If
- End Sub
- Sub Arrange_Scale_100_Click ()
- itgOrgChart.DrawScale = 100
- Arrange_Scale_100.Checked = True
- Arrange_Scale_Fit.Checked = False
- End Sub
- Sub Arrange_Scale_Fit_Click ()
- itgOrgChart.DrawScale = 0
- Arrange_Scale_100.Checked = False
- Arrange_Scale_Fit.Checked = True
- End Sub
- Sub Edit_AddNew_Click ()
- i_selnodeix = -1
- MousePointer = 2
- Edit_Delete.Enabled = False
- Call AllWhite
- End Sub
- Sub Edit_ClearText_Click ()
- itgOrgChart.List(i_selnodeix) = ""
- End Sub
- Sub Edit_Delete_Click ()
- If Not i_selnodeix Then
- itgOrgChart.RemoveItem i_selnodeix
- i_NODECNT = i_NODECNT - 1
- If i_NODECNT = 0 Then
- Call File_Clear_Click
- End If
- Edit_Delete.Enabled = False
- Call AllWhite
- End If
- End Sub
- Sub File_Clear_Click ()
- itgOrgChart.Clear
- File_Print.Enabled = False
- End Sub
- Sub File_Exit_Click ()
- Call ShutDown
- End Sub
- Sub File_Print_Click ()
- itgOrgChart.PrintGraph = 0
- End Sub
- Sub Form_Activate ()
- i_selnodeix = -1
- Call Arrange_Scale_100_Click
- End Sub
- Sub Form_Resize ()
- Call DrawChart(Me)
- Call Arrange_Scale_Fit_Click
- End Sub
- Sub itgOrgChart_Click (Button As Integer, Shift As Integer, X As Integer, Y As Integer)
- Dim nindx%
- If MousePointer = 2 Then
- itgOrgChart.AddItem "<NEW NODE>"
- nindx = itgOrgChart.NewIndex
- itgOrgChart.ItemFillColor(nindx) = LTBLUE
- itgOrgChart.ItemXpos(nindx) = X
- itgOrgChart.ItemYpos(nindx) = Y
- MousePointer = 0
- i_selnodeix = nindx
- i_NODECNT = i_NODECNT + 1
- File_Print.Enabled = True
- Edit_Delete.Enabled = True
- Edit_ClearText.Enabled = True
- Else
- Call AllWhite
- End If
- End Sub
- Sub itgOrgChart_ItemClick (ItemIx As Integer, ItemHandle As Integer, Button As Integer, Shift As Integer, X As Integer, Y As Integer)
- Call AllWhite
- itgOrgChart.ItemFillColor(ItemIx) = LTBLUE
- i_selnodeix = ItemIx
- Edit_Delete.Enabled = True
- Edit_ClearText.Enabled = True
- End Sub
- Sub itgOrgChart_ItemConnect (FromIx As Integer, FromHandle As Integer, ToIx As Integer, ToHandle As Integer, Button As Integer, Shift As Integer)
- itgOrgChart.ConnectTo(FromIx) = ToIx
- End Sub
- Sub itgOrgChart_ItemDblClick (ItemIx As Integer, ItemHandle As Integer, Button As Integer, Shift As Integer, X As Integer, Y As Integer)
- Dim msg$, Cap$
- msg = "There "
- If itgOrgChart.ListCount < 2 Then
- msg = msg & " is currently 1 node"
- Else
- msg = msg & "are currently " & CStr(itgOrgChart.ListCount) & " nodes "
- End If
- msg = msg & " in the organization chart. "
- msg = msg & "The item index property (""ItemIx"") of the selected item is: "
- msg = msg & CStr(ItemIx)
- Cap = "INFO FOR SELECTED NODE"
- MsgBox msg, 64, Cap
- End Sub
- Sub itgOrgChart_KeyPress (KeyAscii As Integer)
- Dim temp$
- If itgOrgChart.List(i_selnodeix) = "<NEW NODE>" Then
- itgOrgChart.List(i_selnodeix) = ""
- End If
- If KeyAscii = 8 Then
- If Len(itgOrgChart.List(i_selnodeix)) > 0 Then
- itgOrgChart.List(i_selnodeix) = Left(itgOrgChart.List(i_selnodeix), Len(itgOrgChart.List(i_selnodeix)) - 1)
- End If
- Else
- itgOrgChart.List(i_selnodeix) = itgOrgChart.List(i_selnodeix) & Chr$(KeyAscii)
- End If
- End Sub
- Sub itgOrgChart_LineDblClick (FromIx As Integer, ToIx As Integer, Button As Integer, Shift As Integer, X As Integer, Y As Integer)
- itgOrgChart.RemoveFrom(FromIx) = ToIx
- End Sub
- Sub ShutDown ()
- End
- End Sub
-